/******************************************************************************
 * Copyright (C) 2012 ShenZhen ComTop Information Technology Co.,Ltd
 * All Rights Reserved.
 * 本软件为深圳康拓普开发研制�?未经本公司正式书面同意，其他任何个人、团体不得使用�?
 * 复制、修改或发布本软�?
 *****************************************************************************/

package com.code.common.nio;

import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

import org.apache.log4j.Logger;

/**
 * 
 * 传输数据管理
 *
 * @author  李鹏
 * @since   1.0
 * @version 2013-3-20 李鹏
 */
public class FileTransferManager {

    /** log对象 */
    private final static Logger LOG = Logger.getLogger(FileTransferManager.class);

    /**
     * 任务调度�?
     */
    private static ScheduledExecutorService  executorService = Executors.newScheduledThreadPool(10);


    public FileTransferManager() {
    	start();
    }

    private void start(){
    	System.out.println("#############  启动NIO服务 #############");
    	//启动接收线程
        Thread objReceiveThread = new Thread(new FileReceivingServer());
        objReceiveThread.start();

        //启动反钝化任�?每小时检查一�?
        //executorService.scheduleWithFixedDelay(new UnPassivationTask(), 0, 1, TimeUnit.MINUTES);
    }

    public static ScheduledExecutorService getExecutorService(){
    	return executorService;
    }
    
    public static void main(String[] args) {
    	FileTransferManager obj=new FileTransferManager();
	}
}